using System;
using System.Collections.Generic;
using System.Text;

namespace GuavaData
{
    public enum LaunchType
    {
        NA, Single, Multi, Root
    }
    public enum ControlType
    {
        None, Entity, Attribute, Container, Extern
    }

    public interface Guava
    {
        LaunchType LType { get;}
        ControlType CType { get;}
        string GText { get;}
        string GName { get; set;}
        System.Drawing.Point GLocation { get;}
        System.Drawing.Size GSize { get;}
        List<Guava> GComponents { get;}
        void GBind (string table, int i);
        string GDefault { get;}
        string GToolTip { get;}
        Domain.Domain GDomain { get;}
        Guava this[string s] { get; }
    }

    public interface GuavaQueryElement : Guava
    {
        bool InQueryMode { get; set; }
        IEnumerable<string> projectColumns { get; }
        IEnumerable<string> distinguishedVariables { get; }
        IDictionary<string, IEnumerable<Condition>> filterConditions { get; }
        Operator AppendQuery(Operator opIn, Dictionary<string, string> currentProjectColumns);
    }

    public delegate void SignalToPersist(object sender, PersistSignalEventArgs e);
    public class PersistSignalEventArgs : EventArgs
    {
        public bool bPersist;

        public PersistSignalEventArgs(bool bPersist)
            : base()
        {
            this.bPersist = bPersist;
        }
    }
    
    public interface GuavaForm : Guava
    {
        Guid ID { get; set;}
        GSeed GS { get; set; }
        bool HasData { get; }
        void Save();
        void Cancel();
        System.Windows.Forms.ToolTip GToolTipProvider { get; }
        void AddGComponent(Guava g);
        event SignalToPersist PersistSignal;
    }

    public interface GuavaLaunchBase
    {
        void SetObject(Guid id);
        void PrepareStackFrame();
        System.Windows.Forms.DialogResult LaunchForm(Guid gid, string form, bool bNew);
    }
}
